/*
    Copyright 2011 - Tommi Laukkanen (www.substanceofcode.com)

    This file is part of MeeToDo.

    MeeToDo is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    MeeToDo is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with MeeToDo. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 1.1

Item {
    id: dialog
    signal ok()
    signal cancel()
    anchors.fill: parent
    state: "hidden"

    function clear() {
        nameInput.text = "";
    }

    Rectangle {
        anchors.fill: parent
        color: "#000"
        opacity: 0.6
    }

    Text {
        id: textBox
        x: 30
        width: parent.width - 60
        anchors.verticalCenter: parent.verticalCenter
        color: "#eee"
        font.pixelSize: 24
        text: "Are you sure you want to remove the whole list?"
        wrapMode: Text.Wrap
    }

    TextButton {
        id: okButton
        label: "Yes, remove"
        width: textBox.width
        x: textBox.x
        //y: 10
        y: textBox.y + textBox.height + 10
        onClicked: {
            dialog.ok();
            dialog.state = "hidden";
        }
    }

    TextButton {
        id: cancelButton
        label: "Cancel"
        width: textBox.width
        x: okButton.x
        y: okButton.y + okButton.height + 10
        onClicked: dialog.cancel();
    }

    states: [
        State {
            name: "hidden"
            PropertyChanges {
                target: dialog
                opacity: 0
            }
        },
        State {
            name: "shown"
            PropertyChanges {
                target: dialog
                opacity: 1
            }
        }
    ]


}
